export function downloadBlob(data: Blob, filename: string) {
  const link = document.createElement('a')
  const objectURL = URL.createObjectURL(data)

  document.body.appendChild(link)
  link.addEventListener('click', () => {
    link.remove()
  })
  link.href = objectURL
  link.download = filename
  link.click()
}
